package com.grm.pojo;

import java.util.Date;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.grm.converter.StringConverter;

import lombok.Data;
 
/**
 * desc: 导入模型
 *
 * @author gaorimao
 * @date 2021/08/19
 */
@Data
public class ImportModel {
	 /**
     * desc: 字段映射，第几列
     */
    @ExcelProperty(value = "姓名" ,index = 0)
    private String name;
 
    @ExcelProperty(value = "性别" ,index = 1)
    private String sex;
 
    @ExcelProperty(value = "年龄" ,index = 2)
    private Integer age;
    
    @ExcelProperty(value = "创建日期" ,index = 3)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    
    //百分比数字
    @ExcelProperty(value = "百分比" ,index = 4)
    @NumberFormat("#.##%")
    private Double doubleData;
    
    //自定义转换格式
    @ExcelProperty(value = "转换格式" ,index = 5,converter = StringConverter.class)
    private String stringTest;
}
